package com.fruit.util;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * 异常工具类
 * @author Administrator 说明：日期处理 创建人：FH Q313596790 
 * @version 2017.12.01 11:40
 */
public class Exceptions {
	/**
	 * 将ErrorStack转化为String.
	 * @param ex ex
	 * @return String
	 * @author Administrator
	 * @version 2017.12.01 11:40
	 */
	public static String getStackTraceAsString(Throwable ex) {
		StringWriter stringWriter = new StringWriter();
		ex.printStackTrace(new PrintWriter(stringWriter));
		return stringWriter.toString();
	}
}
